var bizButtonManager = {
submitErpBizData: function() {
    var d = this.loadErpFromErpGenerateDiv();
    if(null==d||d.erp_no==undefined||d.erp_no=="")return;
    //erpDataMap[d.erp_no] = d;
    //erpDataLoader.flushErpTable();
    systemBiz.addErp(d);
},
generateTempErpBiz:function(conf) {
    var d = erpDataLoader.newNormalData();
    for(a in conf) {
        d[a] = conf[a];
    }
    this.initErpGenerateDiv(d);
},
initErpGenerateDiv:function(erp){
    var i = 0;
    for(a in erp) {
        $($("#erpGenerateDiv input")[i]).val(erp[a]);
        i++;
    }
},
initBigBizGenerateDiv:function(){
    var so = erpDataLoader.generateSo();
    var addr = erpDataLoader.generateAddr();
    $("#addrsGenerateDiv").empty();
    $("#addrsGenerateDiv").append($("<input />"));
    var bigBizType = erpDataLoader.getBigBizType();
    if("单一队列"!=bigBizType) {
        $("#addrsGenerateDiv").append($("<input />"));
    }
    var inputs = $("#bigBizGenerateDiv input");
    $(inputs[0]).val(so);
    $(inputs[1]).val(addr);
    if("单一队列"!=bigBizType) {
        $(inputs[2]).val(erpDataLoader.generateAddr());
    }
},
loadErpFromErpGenerateDiv:function(){
    var d = erpDataLoader.newNormalData();
    var i = 0;
    for(a in d) {
        d[a] = $($("#erpGenerateDiv input")[i]).val();
        i++;
    }
    if(null==d||d.erp_no==undefined||d.erp_no=="")return null;
    $("#erpGenerateDiv input").val("");
    return d;
},
    
submitPairedErpBizData: function() {
    var darr = this.loadPairedErpFromErpGenerateDiv();
    if(null==darr||darr.length!=2||null==darr[0]||darr[0].erp_no==undefined||darr[0].erp_no==""||null==darr[1]||darr[1].erp_no==undefined||darr[1].erp_no=="")return;
    //erpDataMap[darr[0].erp_no] = darr[0];
    //erpDataMap[darr[1].erp_no] = darr[1];
    //systemBiz.doPaire(darr[0],darr[1]);
    //erpDataLoader.flushErpTable();
    systemBiz.addErp(darr[0]);
    systemBiz.addErp(darr[1]);
},
generateTempPairedErpBiz:function(timeType, ioType,bigType) {
    var d1 = erpDataLoader.newNormalData();
    var d2 = erpDataLoader.newNormalData();
    d1.p_erp_no = d2.erp_no;
    d2.p_erp_no = d1.erp_no;
    //d1.fen =erpDataLoader.generateFen();
    //d2.fen =erpDataLoader.generateFen();
    //d1.state = d2.state = "已确认/未派车";
    //d1.currentInSequence = d2.currentInSequence = "是";
    this.initPairedErpGenerateDiv(d1,d2);
},
initPairedErpGenerateDiv:function(d1,d2){
    var i = 0;
    for(a in d1) {
        $($("#erpPairedGenerateDiv input")[i]).val(d1[a]);
        i++;
    }
    for(a in d2) {
        $($("#erpPairedGenerateDiv input")[i]).val(d2[a]);
        i++;
    }
},
loadPairedErpFromErpGenerateDiv:function(){
    var d1 = erpDataLoader.newNormalData();
    var d2 = erpDataLoader.newNormalData();
    var darr = [];
    var i = 0;
    for(a in d1) {
        d1[a] = $($("#erpPairedGenerateDiv input")[i]).val();
        i++;
    }
    for(a in d2) {
        d2[a] = $($("#erpPairedGenerateDiv input")[i]).val();
        i++;
    }
    if(null==d1||d1.erp_no==undefined||d1.erp_no==""||null==d2||d2.erp_no==undefined||d2.erp_no=="")return null;
    $("#erpPairedGenerateDiv input").val("");
    darr.push(d1);//.push(d2);
    darr.push(d2);
    return darr;
}
};